#home_news {
  padding-top: 10px;
  padding-bottom: 10px;
}
/* Shared dl>dt>dd card look, used by both the desktop grid and the
   mobile swiper -- images/placeholder color live in dt, the caption
   overlay lives in dd. */
#home_news dl {
  position: relative;
  margin: 0;
  height: 100%;
  overflow: hidden;
}
#home_news dl dt {
  margin: 0;
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  background: #ccc;
}
#home_news dl dt img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 1s ease;
}
/* Height is intentionally NOT fixed -- it was originally clamped to
   a 2-line box (min/max-height + overflow:hidden), which cut off any
   caption longer than that. Now it just grows with its content
   (only one of the 3 lg-EN/SP/FR spans inside is ever visible at a
   time -- see main.css's html.lg-XX rules -- so the box's height
   always matches whichever language is actually showing). */
#home_news dl dd {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  line-height: 1.3em;
  text-align: center;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-weight: 600;
  padding: 4px 10px;
  box-sizing: border-box;
  font-size: 14px;
  z-index: 2;
}
/* Publish-date badge, top-left corner -- same on desktop and mobile. */
#home_news dl .nw-date-badge {
  position: absolute;
  top: 0;
  left: 0;
  background: rgb(187, 147, 76);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  padding: 4px 8px;
  z-index: 3;
}

#home_news .home-news {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 10px;
  width: 100%;
  height: 430px;
}
/* Each slot is either an <a> (real record) or a <dl> (placeholder) --
   the universal selector keeps grid placement working for either. */
#home_news .home-news > * {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: inherit;
}
#home_news .home-news > *:nth-child(1) { grid-column: 1 / 3; grid-row: 1 / 3; }
#home_news .home-news > *:nth-child(2) { grid-column: 3; grid-row: 1; }
#home_news .home-news > *:nth-child(3) { grid-column: 4; grid-row: 1; }
#home_news .home-news > *:nth-child(4) { grid-column: 3; grid-row: 2; }
#home_news .home-news > *:nth-child(5) { grid-column: 4; grid-row: 2; }
#home_news .home-news > *:nth-child(6),
#home_news .home-news > *:nth-child(7),
#home_news .home-news > *:nth-child(8),
#home_news .home-news > *:nth-child(9) {
  display: none;
}

/* Wide monitors: widen the section so a 3rd column of two images (7 photos total)
   fits without shrinking the other columns */
@media (min-width: 1550px) {
  #home_news section {
    width: 1440px !important;
    margin: 0 auto !important;
  }
  #home_news .home-news {
    grid-template-columns: repeat(5, 1fr);
  }
  #home_news .home-news > *:nth-child(6) {
    display: block;
    grid-column: 5;
    grid-row: 1;
  }
  #home_news .home-news > *:nth-child(7) {
    display: block;
    grid-column: 5;
    grid-row: 2;
  }
}

/* Extra-wide monitors: widen the section further so a 4th column of two images
   (9 photos total, the max: 1 large image + 4 columns of two) also fits without smashing */
@media (min-width: 1850px) {
  #home_news section {
    width: 1730px !important;
    margin: 0 auto !important;
  }
  #home_news .home-news {
    grid-template-columns: repeat(6, 1fr);
  }
  #home_news .home-news > *:nth-child(8) {
    display: block;
    grid-column: 6;
    grid-row: 1;
  }
  #home_news .home-news > *:nth-child(9) {
    display: block;
    grid-column: 6;
    grid-row: 2;
  }
}

/* Below 768px: swap the grid for a Swiper carousel instead of stacking rows */
#home_news .home-news-swiper {
  display: none;
}

@media (max-width: 767px) {
  #home_news .home-news {
    display: none;
  }
  #home_news .home-news-swiper {
    display: block;
    width: 100%;
  }
  #home_news .home-news-swiper .swiper-slide {
    height: 260px;
  }
  #home_news .home-news-swiper .swiper-slide > * {
    display: block;
    height: 100%;
    text-decoration: none;
    color: inherit;
  }
  /* Pushes the pagination dots out of the image area entirely --
     Swiper's default keeps them absolutely positioned near the
     bottom of the slide, overlapping the caption. Reserving space
     below the container (padding-bottom) and pinning the dots to
     the bottom of THAT space moves them below the image instead. */
  #home_news .home-news-swiper.swiper-container {
    padding-bottom: 24px;
  }
  #home_news .home-news-swiper .swiper-pagination {
    bottom: 2px;
  }
  /* White dots made sense sitting on top of a photo; now that they
     sit on the plain page background below it, white would be
     invisible -- switched to a dark neutral / brand-blue pairing. */
  #home_news .home-news-swiper .swiper-pagination-bullet {
    background: rgba(0, 0, 0, 0.25);
    opacity: 1;
  }
  #home_news .home-news-swiper .swiper-pagination-bullet-active {
    background: #007a9e;
    opacity: 1;
  }
}
